package com.zzl.bonds.ticket.feign;

import com.zzl.apidoc.annotation.ApidocOperation;
import com.zzl.apidoc.annotation.ApidocParam;
import com.zzl.general.common.apidoc.annotation.ApidocReturnR;
import com.zzl.general.common.feign.config.FeignClientsConfig;
import com.zzl.general.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 用户中心的feign接口
 */
@FeignClient(value = "user", configuration = FeignClientsConfig.class)
public interface UserFeign {


    /**
     *
     * @param menuAction menuAction
     * @param enterpriseId enterpriseId
     * @return  用户 集合
     */
    @GetMapping("user/feign/getUserIdListByButtonAction/{menuAction}/{enterpriseId}")
    @ApidocOperation(description = "查询拥有按钮权限的用户列表", operationId = "/getUserIdListByButtonAction/menuAction2")
    List<Integer> getUserIdListByButtonAction(@ApidocParam(name = "menuAction", description = "按钮操作", required = true)
                                              @PathVariable("menuAction") String menuAction, @PathVariable("enterpriseId") String enterpriseId);

    /**
     * 通过id获取用户表数据
     *
     * @param userId 用户id
     * @return 用户信息
     */
    @GetMapping("user/feign/getUserInfo/{userId}")
    Result getUserInfo(@PathVariable("userId") Integer userId);

    /**
     * 根据企业id查询根部门id
     * @param enterpriseId
     * @return
     */
    @GetMapping("user/feign/getOrgIdListByEnterpriseId/{enterpriseId}")
    @ApidocOperation(description = "根据企业id查询根部门id", operationId = "/getOrgIdByEnterpriseId/enterpriseId")
    @ApidocReturnR
    List<String> getOrgIdListByEnterpriseId(@ApidocParam(name = "enterpriseId", required = true) @PathVariable("enterpriseId") String enterpriseId);
}
